<%@ Page Language="C#" MasterPageFile="~/admin/AdminMasterPage.master" AutoEventWireup="true" CodeFile="frmUsersView.aspx.cs" Inherits="admin_frmUsersView" Title="Users View"%>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

    <div class="headerCell">View Users</div>
    
    <!--Search Control-->
    <div class="contactFormSearch">
    
        <!--Collapsable Function Div-->
        <div id="collapse">
            <a href="javascript:collapseUser.slideit();">
                <img src="images/expand.png" alt="Expand" title="Expand" style="border:none; position:relative; top:0px" />
            </a>
        </div>
        <!--Div to make width of search control narrower-->
        <div id="divSearchControl" visible="false">
            
            <!--This div is used just to set the padding-->
            <div style="padding:5px">
            
                <div class="searchLabel">&nbsp;Search Field:</div>
                <div class="searchField">
                    <asp:DropDownList ID="lstSearchField" runat="server" CssClass="lstItem">
                        <asp:ListItem Selected="True" Value="--All--">--All--</asp:ListItem>
                        <asp:ListItem Value="strFirstName">First Name</asp:ListItem>
                        <asp:ListItem Value="strSurname">Surname</asp:ListItem>
                        <asp:ListItem Value="strEmailAddress">Email Address</asp:ListItem>
                        
                    </asp:DropDownList> 
                </div>
                
                <b class="spacer"></b>

                <div class="searchLabel">&nbsp;Search Criteria:</div>
                <div class="searchField">
                    <asp:TextBox ID="txtSearchCriteria" runat="server" CssClass="textBox" onKeyUp="return SetMaxLength(this,80)"></asp:TextBox>
                </div>
                
                <b class="spacer"></b><b class="spacer"></b>
                
                <asp:ImageButton ID="btnSearch" ImageUrl="images/btnSearch.png" AlternateText="Search" runat="server" /> 

            </div>
            
        </div>
                         
    </div>
    <!--End Search Control-->
    
    <asp:DataGrid 
        ID="dgrGrid" Runat="server" AutoGenerateColumns="False" AllowSorting="true" 
        AllowPaging="true" PageSize="15" PagerStyle-Mode="NumericPages" OnPageIndexChanged="dgrGrid_PageIndexChanged" 
        OnSortCommand="dgrGrid_SortCommand" CellPadding="3" CellSpacing="0" HeaderStyle-CssClass="dgrHeader" 
        PagerStyle-NextPageText="Next" PagerStyle-PrevPageText="Prev"
        ItemStyle-CssClass="dgrItem" AlternatingItemStyle-CssClass="dgrAltItem" PagerStyle-CssClass="dgrPg" CssClass="dgr">
        <Columns>
            <asp:BoundColumn DataField="iUserID" Visible="false" />
            
            <asp:BoundColumn DataField="strFirstName" SortExpression="strFirstName" HeaderText="First Name" HeaderStyle-ForeColor="white" ItemStyle-BorderColor="#D8D9DA" />
            <asp:BoundColumn DataField="strSurname" SortExpression="strSurname" HeaderText="Surname" HeaderStyle-ForeColor="white" ItemStyle-BorderColor="#D8D9DA" />
            <asp:BoundColumn DataField="strEmailAddress" HeaderText="Email" ItemStyle-BorderColor="#D8D9DA" />

            <asp:TemplateColumn HeaderText="Edit Password" ItemStyle-CssClass="dgrEditPass" HeaderStyle-HorizontalAlign="Center" HeaderStyle-Width="100px" ItemStyle-BorderColor="#D8D9DA">
                <ItemTemplate>
                    <asp:HyperLink ID="lnkEditPass" runat="Server" OnDataBinding="dgrGrid_PopEditPassLink" ItemStyle-BorderColor="#D8D9DA" />
                </ItemTemplate>
            </asp:TemplateColumn>

            <asp:TemplateColumn HeaderText="Edit" HeaderStyle-HorizontalAlign="Center" HeaderStyle-Width="50px" ItemStyle-BorderColor="#D8D9DA">
                <ItemTemplate>
                    <asp:HyperLink ID="lnkEditItem" runat="Server" OnDataBinding="dgrGrid_PopEditLink" />
                </ItemTemplate>
            </asp:TemplateColumn>

            <asp:TemplateColumn HeaderText="Delete" HeaderStyle-HorizontalAlign="Center" HeaderStyle-Width="50px" ItemStyle-BorderColor="#D8D9DA">
                <ItemTemplate>
                    <asp:HyperLink ID="lnkDeleteItem" runat="Server" OnDataBinding="dgrGrid_PopDeleteLink" />
                </ItemTemplate>
            </asp:TemplateColumn>
            
        </Columns> 
    </asp:DataGrid>
    
    <div class="buttons">
        <asp:ImageButton ID="btnAdd" ImageUrl="images/btnAdd.png" AlternateText="Add User" CssClass="btnAdd" runat="server" OnClick="btnAdd_Click" /> 
    </div>
            
    <script language="javascript" type="text/javascript">
        //Syntax: var uniquevar=new animatedcollapse("DIV_id", animatetime_milisec, enablepersist(true/fase), [initialstate] )
        var collapseUser = new animatedcollapse("divSearchControl", 600, true, "none")
        if (document.getElementById("divSearchControl").visible == "false")
        {
            document.getElementById("divSearchControl").style.position  = "relative"
            document.getElementById("divSearchControl").style.top = "0px"
        }
    </script>

</asp:Content>

